package com.dsg.service.apply;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dsg.entity.apply.DsgApplyBill;
import com.dsg.entity.apply.DsgApplyPay;
import com.dsg.entity.dto.SupApproveDto;
import org.apache.ibatis.annotations.Param;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 * 业务申请单 服务类
 * </p>
 *
 * @author system
 * @since 2020-07-10
 */
public interface IDsgApplyBillService extends IService<DsgApplyBill>, IDsglService<DsgApplyBill> {
    Page<DsgApplyBill> selectSalesManagerList(Page<DsgApplyBill> page, @Param("en") DsgApplyBill entity);
    Page<DsgApplyBill> selectSalesWaitingList(Page<DsgApplyBill> page, @Param("en") DsgApplyBill entity);
    DsgApplyBill getBillByCard(String cardId);

    String genBillAndGetAppNo(String cusNo) throws Exception;

    @Transactional(rollbackFor = Exception.class)
    DsgApplyBill genAddPaymentBill(DsgApplyPay pay) throws Exception;

    Page<SupApproveDto> selectSupApproveList(Page<SupApproveDto> page, Integer appType, String APPROVE_STATUS, String entCode);
    List<DsgApplyBill> selectApproveList();
    Page<DsgApplyBill> csWaitingList(Page<DsgApplyBill> page, DsgApplyBill entity);
    Page<DsgApplyBill> selectByList(Page<DsgApplyBill> page, DsgApplyBill entity);
    //    public List<DsgApplyBill> timeoutBill(String billOid);
    boolean carFileComplete(String carOid);

    boolean otherFileComplete(String appNo);

    Page<DsgApplyBill> selectUncheckedBill(Page<DsgApplyBill> page, DsgApplyBill bill, boolean isChecked);

    /**
     * 内审
     * @param bill
     * @return
     * @throws Exception
     */
    boolean internalAudit(DsgApplyBill bill) throws Exception;

    /**
     * 取消過期補領
     * @param asList
     * @return
     */
    boolean cancelExpiredReplacement(List<String> asList);
}
